﻿@model OnlineItemViewModel
<script type="text/javascript">
	var msgsF = [];
    @foreach (VideoSeller.Business.Data.CultureResource file in Html.GetResources("Flash"))
    {
      <text>msgsF["@file.ResourceName"] = '@file.ResourceValue';</text>
    }
</script>
@{
		var noRight = false;
		var c640 = "";
		var c640x = "";
		var x640 = "";
		if (@Model.VideoContentType != VideoSeller.Business.Data.Enums.VideoContentType.PaidGroups)
		{
			c640 = "xy_640x480_";
			c640x = "xy_640x480x_";
			x640 = "x640=1&amp;";
		}
		
}

@if (!noRight && ( Model.Author.UserId == Model.CurrentUserId || (Model.Price > 0 && Model.IsPaid) || Model.Price == 0))
{
		if (@Model.VideoContentType == VideoSeller.Business.Data.Enums.VideoContentType.PaidGroups)	
		{
			foreach(VideoSeller.Business.Data.OnlineContentHistory hFiles in @Model.HistoryFiles)
			{
			<div class="flashDiv">
				<div class="history_container">
					<label class="play_msg" id="@string.Format("lmeets{0}_msg", hFiles.Id)"></label>
					<div class="history-player">
						<script type="text/jscript">
							if (AC_FL_RunContent != 0) {
							    addpplayer('@string.Format("lmeet{0}", hFiles.Id)', '@Model.HistoryPath', '@Model.CurrentUserId', '@Model.CurrentSessionId', '@hFiles.FilePath', 'offline', "ifile=1&amp;");
							}
						</script>
					</div>
					 <div class="live_bt_panel"></div>
                    <div style="clear: both;"></div>

				</div>
			</div>
			}
		}
		else
		{
				<div class="flashDiv @c640x">
				<div class="history_container" >
					<label class="play_msg" id="live1_msg"></label>
					<div class="history-player @c640">
						<script type="text/jscript">
							if (AC_FL_RunContent != 0) {
							    addpplayer('live1', '@Model.HistoryPath', '@Model.CurrentUserId', '@Model.CurrentSessionId', '@Model.DownloadUrl', 'offline', "ifile=1&amp; @x640");
							    addView('@Model.Id', '@Model.CurrentUserId', 'H');
							}
						</script>

					</div>
                    <div class="live_bt_panel"></div>
					<div style="clear: both;"></div>

				</div>
			</div>

        }

<div style="clear: both;"></div>
   
}
